/*
 * SignalData.h
 *
 *  Created on: Jul 13, 2009
 *      Author: zaca
 */

#ifndef SIGNALDATA_H_
#define SIGNALDATA_H_

#include "sourcesignal.h"
#include <vector>

namespace biosignal {

using namespace std::tr1;

class SignalData;

class DataIterator : public std::iterator<std::forward_iterator_tag,
            double, long>
{
public:
    DataIterator() {};
    DataIterator(const SignalData* signal_data, long current_id=0);
    bool operator==(const DataIterator & other) const;
    bool operator!=(const DataIterator& other) const;
    double operator*() const;
    DataIterator& operator++();
    DataIterator& operator--();
    DataIterator operator++(int);
private:
    long m_current_id;
    const SignalData* m_signal_data;
};


class SignalData {
public:
    SignalData(const SourceSignal* signal_info);
    virtual ~SignalData();
    virtual void value(unsigned int sample_nr, double value) = 0;
    virtual double value(unsigned int sample_nr) const = 0;
    virtual int size() const = 0;
    const SourceSignal* signal_info() const;

    DataIterator begin() const;
    DataIterator end() const;
private:
    const SourceSignal* m_signal_info;

};

}
#endif /* SIGNALDATA_H_ */
